package com.shujia.day12;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Demo11BuffedWriter {
    public static void main(String[] args) throws IOException {
        /*
            TODO 缓冲流
                    BufferedWriter
                        write 写出一个字符串
                        newLine 创建新的一行
         */
        String path = "data/buffer.txt";
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(path));
        for (int i = 0; i < 10; i++) {
            bufferedWriter.write("这是一行数据");
            bufferedWriter.newLine();
        }
        bufferedWriter.close();

    }
}
